package com.bettosimport.datos;

import java.sql.*;

public class ConexionDAO {

    private static ConexionDAO _Instancia;

    private ConexionDAO() {
    }

    public static ConexionDAO Instancia() {
        if (_Instancia == null) {
            _Instancia = new ConexionDAO();
        }
        return _Instancia;
    }

    public Connection getConexion() throws Exception {
        Connection cn = null;
        try {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            cn = DriverManager.getConnection("jdbc:sqlserver://192.168.233.137:1433; "
                    + "databaseName=BDBettosImport", "sa", "12345");
        } catch (Exception e) {
            System.out.print("Error al conectar a la BD");
            throw e;
        }
        return cn;
    }
}
